home *** CD-ROM | disk | FTP | other *** search
- #include "Protos.h"
-
- Boolean IsAppWindow(WindowPtr window)
- /*
- Determine if the window in question belongs to our application
- or a desk accessory.
- */
- {
- if (window == NULL)
- return false;
- else
- return ((WindowPeek) window)->windowKind >= 0;
- }
-
- Boolean IsDAWindow(WindowPtr window)
- {
- if (window == NULL)
- return false;
- else
- return ((WindowPeek) window)->windowKind < 0;
- }
-
- void DoDeactivate(WindowPtr window)
- {
- if (IsAppWindow(window))
- {
- HiliteControls(window,FALSE);
- }
- }
-
- void DoActivate(WindowPtr window)
- {
- if (IsAppWindow(window))
- {
- HiliteControls(window,TRUE);
-
- InitCursor();
- }
- }
-
- void HiliteControls(WindowPtr theWindow, Boolean active)
- /*
- Traverse the control list of theWindow, highlighting each as appropriate
- */
- {
- WindowPeek windPeek;
- ControlHandle trav;
-
- windPeek = (WindowPeek) theWindow;
- trav = windPeek->controlList;
- while (trav != NULL)
- {
- if (active)
- HiliteControl(trav,0);
- else
- HiliteControl(trav,255);
- trav = (*trav)->nextControl;
- }
- }
-
-